package cn.dlc.com.message;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("msg")
public class MsgController {

    @Autowired
    private MsgSender sender;

    @Autowired
    private MsgCustomSender customSender;

    @GetMapping("send")
    public Map<String,Object> send(){
        Map<String, Object> map = new HashMap<>();
        map.put("name","木鱼啊");
        sender.send(map);
        return map;
    }

    @GetMapping("custom/send")
    public Map<String,Object> customSend(){
        Map<String, Object> map = new HashMap<>();
        map.put("name","木鱼啊,你好啊！");
        customSender.send(map);
        return map;
    }
}
